package com.cljh.mapper;

import com.cljh.bean.Path;
import com.cljh.bean.Role;
import org.apache.ibatis.annotations.*;

import java.awt.*;
import java.util.List;

@Mapper
public interface MenuMapper {

    @Insert("insert into mtmall_test.menu ( menu_name, menu_path, icon, menu_description, path_id,page_path) values (#{menu.menuName},#{menu.menuPath},#{menu.icon},#{menu.menuDescription},#{menu.pathId},#{menu.pagePath});")
    int save(@Param("menu") Path menu);

    @Delete("delete from mtmall_test.menu where id=#{id};")
    int delete(Integer id);

    int Upd(@Param("menu") Path menu);

    @Select("select * from mtmall_test.menu where id=#{id};")
    Path selectById(Integer id);


    List<Path> selectAll(@Param("begin")Integer begin, @Param("size")Integer size, @Param("menu") String menu);


    int selectCount(@Param("menu") String menu);

    int deleteIds(@Param("ids") List<Integer> ids);

    @Select("select * from mtmall_test.menu order by id;")
    List<Path> selectAllPath();
}
